apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: {{ gpu_nodepool_name | default('gpu') }}
spec:
  disruption:
    consolidateAfter: {{ gpu_consolidate_after | default('1h') }}
    consolidationPolicy: {{ gpu_consolidation_policy | default('WhenEmpty') }}
  template:
    spec:
      nodeClassRef:
        group: eks.amazonaws.com
        kind: NodeClass
        name: {{ karpenter_nodeclass_name | default('default') }}
      requirements:
        - key: karpenter.sh/capacity-type
          operator: In
          values: {{ gpu_capacity_types | default(['on-demand']) }}
        - key: kubernetes.io/arch
          operator: In
          values: {{ gpu_arch | default(['amd64']) }}
        - key: eks.amazonaws.com/instance-family
          operator: In
          values: {{ gpu_instance_families | default(['g6','g6e']) }}
      taints:
        - key: {{ gpu_taint_key | default('nvidia.com/gpu') }}
          effect: NoSchedule
